/**
 * 功能描述 导航
 */
define(function (require, exports, module) {
	var Subnav = require("subnav");
	var Dialog = require("dialog");
	var aw = require("ajaxwrapper");
	var roomStatus = require("../store/FITCharge");
	var Form = require("form");
	var user = require("store").get("user");

//	var enmu = require("enums");
    var instance = {
        initComponent: function (params,widget) {
        	var subnav = new Subnav({
        		parentNode:".J-subnav",
        		model:{
        			title:"散客押金确认",
        			items:[{

					      id :"servicePoint",
					      type : "buttongroup",
					      all : {
					    	  show:false,
					    	  first:true
					      },
					      tip : "服务点",
					      keyField :"pkServicePoint",
					      valueField : "name",
					      items : user.privateServicePoints,
//					      url : "api/servicepoint/operableservicepoints",
					      params : function(){
					    	  return{
					    		  fetchProperties:"pkServicePoint,name"
					    	  }
					      },
					      handler : function(key,element){
					    	  widget.get("grid").refresh();
					      }
				    
        			},{
        				id:"pledgeStatus",
						tip:"状态",						
						type:"buttongroup",
						all: {
			                show: true,
			                position: "top",
			                text: "全部"
			            },
						items:[{
							key:"true",
							value:"已收费",
						},{
							key:"false",
							value:"待收费"
						}],
						handler:function(key,element){
							widget.get("grid").refresh();
						}
        				
        			},{
        				id: "checkInDate",
						tip:"入住时间查询",
						type:"daterange",
						ranges : {
							"今天": [moment().startOf("days"),moment().endOf("days")],
					        "本月": [moment().startOf("month"), moment().endOf("month")],
					        "本年": [moment().startOf("year"), moment().endOf("year")]
						},
						defaultRange : "本月",
						handler : function(time){
							 widget.get("grid").refresh();
						}
        			}]
        		}
        	});
        	widget.set("subnav",subnav);
        }
    };
    module.exports = instance;
});
